package com.zut.common.entity;

import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class Result<T> {
    private Integer code;
    private String message;
    private Boolean success;
    private T data;


    public  Result success(T data){
        Result result =new Result();
        result.setCode(200);
        result.setData(data);
        result.setMessage("成功");
        result.setSuccess(true);
        return result;
    }

    public  Result fail(T data){
        Result result =new Result();
        result.setCode(500);
        result.setData(data);
        result.setMessage("失败");
        result.setSuccess(false);
        return result;
    }
}
